
public class Patrat implements Poligon {
	private Punct a;
    private Punct b;
    private Punct c;
    private Punct d;
    public Patrat(Punct a,Punct b,Punct c,Punct d)
    {
            this.a=a;
            this.b=b;
            this.c=c;
            this.d=d;
    }
    public double perimetru()
    {
            return 4*a.distanta(b);
    }
    public double arie()
    {
            return a.distanta(b)*a.distanta(b);
    }
    public String toString()
    {
            return "Laturile patratului sunt formate din punctele: "+a+" "+b+" "+c+" "+d;
    }


}
